﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using MyFinanceManager.Objects;

namespace MyFinanceManager.PC
{
    /// <summary>
    /// Interaction logic for ucNewViewTransferRecord.xaml
    /// </summary>
    public partial class ucNewViewTransferRecord : UserControl
    {
        public ucNewViewTransferRecord()
        {
            InitializeComponent();
        }

        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            this.contentArea.DataContext = this.itemsArea.SelectedItem;
        }

        private void AddNewPosting_Click(object sender, RoutedEventArgs e)
        {
            TransferRecord pr = this.NewPosting.Value;
            List<TransferRecord> records = this.itemsArea.ItemsSource as List<TransferRecord>;
            if (records != null)
                records.Add(pr);
        }
    }
}
